package com.gagakuai.domain.rules;

import com.gagakuai.domain.actions.Action;
import com.gagakuai.domain.conditions.Condition;

import java.util.List;

/**
 * @description: 规则定义
 * @author: houhong
 * @create: 2024-09-07 10:20
 **/
public interface Rule extends Comparable<Rule> {

    /*
     * 规则类型:
     *   静态规则， 行为规则，动态规则，关联规则，等
     *   不同等规则类型使用不同等判断组件
     */
    Integer TYPE = 0;

    String DEFAULT_NAME = "rule";

    String DEFAULT_DESCRIPTION = "description";
    /*
     * 优先级，值越小，越先执行
     */
    Integer DEFAULT_PRIORITY = Integer.MAX_VALUE - 1;


    List<Action> getActions();

    List<Condition> getConditions();


    Integer getType();

    default String getName() {
        return DEFAULT_NAME;
    }

    default String getDescription() {
        return DEFAULT_DESCRIPTION;
    }

    default Integer getPriority() {
        return DEFAULT_PRIORITY;
    }

}
